
const port = 9999

const route = require("./route")
const koaBody = require('koa-bodyparser')
const views = require('koa-views')  // 引入 模块


const path = require('path')
const static = require('koa-static')

const { app, server } = require('./util/socketApi')

const staticPath = 'resources/static'

app.use(static(path.join(__dirname, staticPath)))

app.use(views('resources/web', { extension: 'ejs' }))
app.use(koaBody())
app.use(route.routes(), route.allowedMethods())

// netstat -tunlp|grep 9999
server.listen(port, () => {
    console.log('port is ' + port)
})



